package com.zzqstart.vod.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * ClassName: ConstantPropertiesUtils
 * Package: com.atguigu.oss.utils
 * Description:
 *
 * @Author zzqstart
 * @Create 2023-02-22 20:20
 * @Version 1.0
 */

// spring将配置文件中的属性复制给成员变量后执行重写的afterPropertiesSet
@Component
public class ConstantPropertiesUtils implements InitializingBean {

    @Value(" ${aliyun.vod.file.keyid}")
    private String keyId;

    @Value(" ${aliyun.vod.file.keysecret}")
    private String keySecret;

    public static String KEY_ID;
    public static String KEY_SECRET;

    @Override
    public void afterPropertiesSet() throws Exception {
        KEY_ID = keyId.trim();
        KEY_SECRET = keySecret.trim();
    }
}
